import request from "@/utils/request";

export const confirmTicket = (order, ticketList, captcha, captchaToken) => {
  const { id, date, trainCode, start, end, startTime, endTime } = order;
  return request.post("/order/confirm-order/confirm", {
    id,
    date,
    trainCode,
    start,
    end,
    ticketList,
    startTime,
    endTime,
    captcha,
    captchaToken,
  });
};

export const getCaptcha = (captchaToken) => {
  return request.post(`/order/confirm-order/captcha/${captchaToken}`);
};


export const getOrderStatus = (orderId) => {
  return request.post(`/order/confirm-order/waiting-status/${orderId}`);
};

export const cancelConfirmOrder = (orderId) => {
  return request.delete(`/order/confirm-order/cancel/${orderId}`);
};